/* -------------------------------------------------------------------
 *    Application class for RubiksCube
 *
 *    $File: RubiksCubeView.h
 *    $Date: 2013/01/31 $
 *    $Revision: #1 $
 * -------------------------------------------------------------------*/
#ifndef RUBIKSCUBEVIEW
#define RUBIKSCUBEVIEW

#include <vlgGLObserver.h>
#include <vlgSolidPlate.h>
#include <vlgGLPointLight.h>
#include "RubiksCubeModel.h"

//! distance of mirror from wks origin
static const float distance = 8.0f;

//! View for RubiksCube
class RubiksCubeView : public vlgGLObserver {

public:
	//! c'tor
	RubiksCubeView(RubiksCubeModel &m);
	//! draw the entire scene
	virtual void draw(void);
	//! update function
	virtual bool update(const vlgSubject &changedSubject);
	//! initialize further OpenGL stuff
	void initContext(void);

private:
	//! coresponding model
	RubiksCubeModel &model;
	//! explosion grade
	float explosionGrade;
	//! light source
	vlgGLPointLight* pointLight;	
	//! left mirror
	vlgSolidPlate* leftMirror;
	//! bottom mirror
	vlgSolidPlate* bottomMirror;
	//! back mirror
	vlgSolidPlate* backMirror;
	//! draw left mirror
	void drawLeftMirror(void);
	//! draw bottom mirror
	void drawBottomMirror(void);
	//! draw back mirror
	void drawBackMirror(void);
	//! draw the Rubiks Cube
	void drawRubiksCube(void) ;
};

#endif // RUBIKSCUBEVIEW